#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QStackedWidget>

class LoginWindow : public QWidget
{
    Q_OBJECT

public:
    explicit LoginWindow(QStackedWidget *stackedWidget, QWidget *parent = nullptr);

private:
    QLabel* m_captchaLabel;
    QLineEdit* m_usernameInput;
    QLineEdit* m_passwordInput;
    QLineEdit* m_captchaInput;
    QPushButton* m_loginButton;
    QPushButton* m_registerButton;
    QPushButton* m_refreshCaptchaButton;
    QString m_currentCaptcha;

    QStackedWidget *stackedWidget;

    void generateCaptcha();
    void initUI();
    void setupConnections();

private slots:
    void onLoginClicked();
    void onRegisterClicked();
    void onRefreshCaptcha();
};

#endif // LOGINWINDOW_H
